package com.wdc.patterns.singleton.demo5;

/**
 * 内部类实例化单例
 */
public class Singleton {
    private Singleton() {

    }

    //在静态内部类中声明
     private static class SingletonHolder{
         private static final   Singleton INSTANCE = new Singleton();
    }

    public static Singleton getInstance() {
        return SingletonHolder.INSTANCE;
    }

}
